import { dataDispose } from '../../assets/comFun'
//导航栏icon
import { DatabaseOutlined } from "@ant-design/icons"

//计划列表
import PlanList from './PlanList/PlanList'
//添加生产计划页面
import AddPlan from './PlanList/AddPlan'

//待办任务-我的任务/部门任务
import AwaitPlanList from './AwaitPlan/AwaitPlanList'

//历史任务
import HistoryPlan from './HistoryPlan/HistoryPlan'

//详情页面
import ProductionPlanDetails from './ProductionPlanDetails'
// //生产计划设置
// import ProductionPlanSet from './ProductionPlanSet'

const enumLeftProductionPlan = [
    {
        key: 'productionPlan',
        meta: {
            title: "生产计划",
            icon: <DatabaseOutlined />,
        },
        authority: 'SCJH',
        path: "/planing",
        component: PlanList,
        page: [
            {
                key: 'planing',
                meta: {
                    title: "执行中",
                    icon: <DatabaseOutlined />,
                },
                authority: 'ZXZ',
                path: "/planing",
                component: PlanList,
            },
            {
                key: 'stopPlan',
                meta: {
                    title: "挂起",
                    icon: <DatabaseOutlined />,
                },
                authority: 'GQ',
                path: "/stopPlan",
                component: PlanList,
            },
            {
                key: 'awaitNextPlan',
                meta: {
                    title: "待下发",
                    icon: <DatabaseOutlined />,
                },
                authority: 'DXF',
                path: "/awaitNextPlan",
                component: PlanList,
            }
        ],
    },
    {
        key: 'awaitPlan',
        meta: {
            title: "待办任务",
            icon: <DatabaseOutlined />,
        },
        authority: 'DBRW_SC',
        path: "/awaitPlanList",
        component: AwaitPlanList,
        page: [
            {
                key: 'myAwaitPlanList',
                meta: {
                    title: "我的任务",
                    icon: <DatabaseOutlined />,
                },
                authority: 'WDRW_SC',
                path: "/myAwaitPlanList",
                component: AwaitPlanList,
            },
            {
                key: 'departmentAwaitPlanList',
                meta: {
                    title: "部门任务",
                    icon: <DatabaseOutlined />,
                },
                authority: 'BMRW_SC',
                path: "/departmentAwaitPlanList",
                component: AwaitPlanList,
            }
        ],
    },
    {
        key: 'historyPlan',
        meta: {
            title: "历史任务",
            icon: <DatabaseOutlined />,
        },
        authority: 'LSRW_SC',
        path: "/historyPlan",
        component: HistoryPlan
    },
    // {
    //     key: 'productionPlanSet',
    //     meta: {
    //         title: "生产总线设置",
    //         icon: <DatabaseOutlined />,
    //     },
    //     path: "/productionPlanSet",
    //     component: ProductionPlanSet
    // },
]

//侧边栏数据转成路由
let enumLeftProductionPlanRouter = dataDispose(enumLeftProductionPlan);

const enumLeftProductionPlanRouterPage = [
    ...enumLeftProductionPlanRouter,
    {
        path: "/addPlan",
        component: AddPlan
    },
    {
        path: "/productionPlan/details",
        component: ProductionPlanDetails
    }
]

export {
    enumLeftProductionPlan,
    enumLeftProductionPlanRouterPage
}
